package org.millioncall.yueyoga.admin.model;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.millioncall.yueyoga.admin.model.base.BaseMember;

public class Member extends BaseMember implements Serializable {
	private static final long serialVersionUID = 2580150037507468204L;
	private String levelName;
	private String marketingchannel;

	private String outsideCardNo;// 卡外码
	private String productName;// 产品名
	private Date productEndTime;// 有效期
	private Date lastConsumeTime;// 最后到馆日期

	public Date getLastConsumeTime() {
		return lastConsumeTime;
	}

	public void setLastConsumeTime(Date lastConsumeTime) {
		this.lastConsumeTime = lastConsumeTime;
	}

	public String getLevelName() {
		return levelName;
	}

	public String getOutsideCardNo() {
		return outsideCardNo;
	}

	public void setOutsideCardNo(String outsideCardNo) {
		this.outsideCardNo = outsideCardNo;
	}

	public void setLevelName(String levelName) {
		this.levelName = levelName;
	}

	public String getMarketingchannel() {
		return marketingchannel;
	}

	public void setMarketingchannel(String marketingchannel) {
		this.marketingchannel = marketingchannel;
	}

	public String getProductName() {
		return productName;
	}

	public void setProductName(String productName) {
		this.productName = productName;
	}

	public Date getProductEndTime() {
		return productEndTime;
	}

	public String getStringOfProductEndTime() {
		SimpleDateFormat sdt = new SimpleDateFormat("yyyy-MM-dd");
		if (this.productEndTime == null) {
			return "";
		} else {
			return sdt.format(this.productEndTime);
		}
	}

	/**
	 * 产品是否已过期
	 * 
	 * @return
	 */
	public boolean isProductExpired() {
		if (this.productEndTime == null) {
			return false;
		} else {
			return this.productEndTime.before(new Date());
		}
	}

	public void setProductEndTime(Date productEndTime) {
		this.productEndTime = productEndTime;
	}

}